package com.yungu.swift.socket;

import com.yungu.swift.socket.communication.server.NettyRunner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ImportResource;
import org.springframework.kafka.annotation.EnableKafka;

import javax.annotation.Resource;

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@ImportResource(value = {"classpath:dubbo-provider.xml"})
@EnableConfigurationProperties
@EnableKafka
public class Application implements CommandLineRunner {

    @Resource
    private NettyRunner nettyRunner;

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
        System.out.println("Application启动成功");
    }

    @Override
    public void run(String... strings) {
        nettyRunner.run();
    }

}
